package com.example.lizhixin.object_three_team.Game_frag;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.lizhixin.object_three_team.Adapter.GameRcdAdapter;
import com.example.lizhixin.object_three_team.Base.BaseFragment;
import com.example.lizhixin.object_three_team.R;
import com.jcodecraeer.xrecyclerview.XRecyclerView;

import java.util.ArrayList;
import java.util.List;

/**
 * A simple {@link Fragment} subclass.
 */
public class RecommendFragment extends BaseFragment {
    private  XRecyclerView recyclerView;
    private GameRcdAdapter rcdAdapter;
    private List<String> list ;
    public RecommendFragment() {
    }




    @Override
    protected void initData() {
        list = new ArrayList<>();
        list.add("https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3530976499,2006878236&fm=27&gp=0.jpg");
        list.add("https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=2861193560,1499310257&fm=27&gp=0.jpg");
        list.add("https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1728939054,3627344316&fm=27&gp=0.jpg");
        LinearLayoutManager manager = new LinearLayoutManager(getContext());
        recyclerView.setLayoutManager(manager);
        rcdAdapter = new GameRcdAdapter();
        rcdAdapter.referch(list);
        recyclerView.setAdapter(rcdAdapter);

    }

    @Override
    protected int attachLayoutRes() {
        return R.layout.fragment_recommend;
    }

    @Override
    protected void initView() {
     recyclerView = getActivity().findViewById(R.id.game_XRv);
    }

}
